<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Jetson Inference: jetson-utils/gstCamera.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="NVLogo_2D.jpg"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Jetson Inference
   </div>
   <div id="projectbrief">DNN Vision Library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('gstCamera_8h_source.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">gstCamera.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="gstCamera_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> * Permission is hereby granted, free of charge, to any person obtaining a</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> * copy of this software and associated documentation files (the &quot;Software&quot;),</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> * to deal in the Software without restriction, including without limitation</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment"> * the rights to use, copy, modify, merge, publish, distribute, sublicense,</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment"> * and/or sell copies of the Software, and to permit persons to whom the</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment"> * Software is furnished to do so, subject to the following conditions:</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment"> * The above copyright notice and this permission notice shall be included in</span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment"> * all copies or substantial portions of the Software.</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment"> * THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span></div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment"> * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span></div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment"> * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL</span></div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment"> * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span></div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment"> * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING</span></div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment"> * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER</span></div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment"> * DEALINGS IN THE SOFTWARE.</span></div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="comment"> */</span></div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;</div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="preprocessor">#ifndef __GSTREAMER_CAMERA_H__</span></div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="preprocessor">#define __GSTREAMER_CAMERA_H__</span></div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;</div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="preprocessor">#include &lt;gst/gst.h&gt;</span></div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="preprocessor">#include &lt;string&gt;</span></div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;</div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="Mutex_8h.html">Mutex.h</a>&quot;</span></div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="Event_8h.html">Event.h</a>&quot;</span></div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;</div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;</div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="comment">// Forward declarations</span></div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="keyword">struct </span>_GstAppSink;</div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;</div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;</div><div class="line"><a name="l00041"></a><span class="lineno"><a class="line" href="group__gstCamera.html#ga785111db387205d710d3a087c2ad3091">   41</a></span>&#160;<span class="keyword">enum</span> <a class="code" href="group__gstCamera.html#ga785111db387205d710d3a087c2ad3091">gstCameraSrc</a></div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;{</div><div class="line"><a name="l00043"></a><span class="lineno"><a class="line" href="group__gstCamera.html#gga785111db387205d710d3a087c2ad3091aa2b01206d25737bf103c037cf4925403">   43</a></span>&#160;        <a class="code" href="group__gstCamera.html#gga785111db387205d710d3a087c2ad3091aa2b01206d25737bf103c037cf4925403">GST_SOURCE_NVCAMERA</a>,    <span class="comment">/* use nvcamerasrc element */</span></div><div class="line"><a name="l00044"></a><span class="lineno"><a class="line" href="group__gstCamera.html#gga785111db387205d710d3a087c2ad3091ad6c785a043fa1eeb687356169f6fc11e">   44</a></span>&#160;        <a class="code" href="group__gstCamera.html#gga785111db387205d710d3a087c2ad3091ad6c785a043fa1eeb687356169f6fc11e">GST_SOURCE_NVARGUS</a>,             <span class="comment">/* use nvargussrc element */</span></div><div class="line"><a name="l00045"></a><span class="lineno"><a class="line" href="group__gstCamera.html#gga785111db387205d710d3a087c2ad3091a77873b0e7f5d0ca158d898fbb90894e5">   45</a></span>&#160;        <a class="code" href="group__gstCamera.html#gga785111db387205d710d3a087c2ad3091a77873b0e7f5d0ca158d898fbb90894e5">GST_SOURCE_V4L2</a>         <span class="comment">/* use v4l2src element */</span></div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;};</div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;</div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;<span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="group__gstCamera.html#ga82c0d21c049992867131001bbb9169af">gstCameraSrcToString</a>( <a class="code" href="group__gstCamera.html#ga785111db387205d710d3a087c2ad3091">gstCameraSrc</a> src );   </div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;</div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;</div><div class="line"><a name="l00070"></a><span class="lineno"><a class="line" href="classgstCamera.html">   70</a></span>&#160;<span class="keyword">class </span><a class="code" href="classgstCamera.html">gstCamera</a></div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;{</div><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;        <span class="keyword">static</span> <a class="code" href="classgstCamera.html">gstCamera</a>* <a class="code" href="classgstCamera.html#a1747140a15dd83dbd3593c375bbc85d0">Create</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* camera=NULL ); <span class="comment">// use MIPI CSI camera by default</span></div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;</div><div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;        <span class="keyword">static</span> <a class="code" href="classgstCamera.html">gstCamera</a>* <a class="code" href="classgstCamera.html#a1747140a15dd83dbd3593c375bbc85d0">Create</a>( uint32_t width, uint32_t height, <span class="keyword">const</span> <span class="keywordtype">char</span>* camera=NULL );</div><div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;        </div><div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;        <a class="code" href="classgstCamera.html#a1df842937128e70d8f140c65e88e783c">~gstCamera</a>();</div><div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;</div><div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;        <span class="keywordtype">bool</span> <a class="code" href="classgstCamera.html#a075aa94acb72f577f7c385e37a8c15b0">Open</a>();</div><div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;</div><div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;        <span class="keywordtype">void</span> <a class="code" href="classgstCamera.html#af8043c610d01bcde93f212f5f5bb0fe1">Close</a>();</div><div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;        </div><div class="line"><a name="l00146"></a><span class="lineno"><a class="line" href="classgstCamera.html#a7142cbf3d2251c023967affa0625ac74">  146</a></span>&#160;        <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="classgstCamera.html#a7142cbf3d2251c023967affa0625ac74">IsStreaming</a>()<span class="keyword"> const    </span>{ <span class="keywordflow">return</span> mStreaming; }</div><div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;</div><div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;        <span class="keywordtype">bool</span> <a class="code" href="classgstCamera.html#a1ae42b24f1ccb8056252614aae6779e5">Capture</a>( <span class="keywordtype">void</span>** cpu, <span class="keywordtype">void</span>** cuda, uint64_t timeout=UINT64_MAX );</div><div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;</div><div class="line"><a name="l00203"></a><span class="lineno">  203</span>&#160;        <span class="keywordtype">bool</span> <a class="code" href="classgstCamera.html#a93371e3811a1956ff96c154fd1da23f2">CaptureRGBA</a>( <span class="keywordtype">float</span>** image, uint64_t timeout=UINT64_MAX, <span class="keywordtype">bool</span> zeroCopy=<span class="keyword">false</span> );</div><div class="line"><a name="l00204"></a><span class="lineno">  204</span>&#160;        </div><div class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160;        <span class="keywordtype">bool</span> <a class="code" href="classgstCamera.html#a4ca28a9fc888afe4ff0a6542de351f56">ConvertRGBA</a>( <span class="keywordtype">void</span>* input, <span class="keywordtype">float</span>** output, <span class="keywordtype">bool</span> zeroCopy=<span class="keyword">false</span> );</div><div class="line"><a name="l00230"></a><span class="lineno">  230</span>&#160;        </div><div class="line"><a name="l00234"></a><span class="lineno"><a class="line" href="classgstCamera.html#a01e94b6f2abedad9ab760dd68b828e80">  234</a></span>&#160;        <span class="keyword">inline</span> uint32_t <a class="code" href="classgstCamera.html#a01e94b6f2abedad9ab760dd68b828e80">GetWidth</a>()<span class="keyword"> const           </span>{ <span class="keywordflow">return</span> mWidth; }</div><div class="line"><a name="l00235"></a><span class="lineno">  235</span>&#160;</div><div class="line"><a name="l00239"></a><span class="lineno"><a class="line" href="classgstCamera.html#a8c0cbb34989ca19042be8b90c176fc47">  239</a></span>&#160;        <span class="keyword">inline</span> uint32_t <a class="code" href="classgstCamera.html#a8c0cbb34989ca19042be8b90c176fc47">GetHeight</a>()<span class="keyword"> const          </span>{ <span class="keywordflow">return</span> mHeight; }</div><div class="line"><a name="l00240"></a><span class="lineno">  240</span>&#160;</div><div class="line"><a name="l00246"></a><span class="lineno"><a class="line" href="classgstCamera.html#abe5444efa860b29c8ce2dff6e3e16dcd">  246</a></span>&#160;        <span class="keyword">inline</span> uint32_t <a class="code" href="classgstCamera.html#abe5444efa860b29c8ce2dff6e3e16dcd">GetPixelDepth</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> mDepth; }</div><div class="line"><a name="l00247"></a><span class="lineno">  247</span>&#160;</div><div class="line"><a name="l00257"></a><span class="lineno"><a class="line" href="classgstCamera.html#a6f02cf79d67b1c204f53a1c7fa369374">  257</a></span>&#160;        <span class="keyword">inline</span> uint32_t <a class="code" href="classgstCamera.html#a6f02cf79d67b1c204f53a1c7fa369374">GetSize</a>()<span class="keyword"> const    </span>{ <span class="keywordflow">return</span> mSize; }</div><div class="line"><a name="l00258"></a><span class="lineno">  258</span>&#160;        </div><div class="line"><a name="l00262"></a><span class="lineno"><a class="line" href="classgstCamera.html#a211a6c9359a2f43054771f15e7628a5e">  262</a></span>&#160;        <span class="keyword">static</span> <span class="keyword">const</span> uint32_t <a class="code" href="classgstCamera.html#a211a6c9359a2f43054771f15e7628a5e">DefaultWidth</a>  = 1280;</div><div class="line"><a name="l00263"></a><span class="lineno">  263</span>&#160;</div><div class="line"><a name="l00267"></a><span class="lineno"><a class="line" href="classgstCamera.html#a42ab558b8ff9a0bf47b768c5122825b7">  267</a></span>&#160;        <span class="keyword">static</span> <span class="keyword">const</span> uint32_t <a class="code" href="classgstCamera.html#a42ab558b8ff9a0bf47b768c5122825b7">DefaultHeight</a> = 720;</div><div class="line"><a name="l00268"></a><span class="lineno">  268</span>&#160;        </div><div class="line"><a name="l00269"></a><span class="lineno">  269</span>&#160;<span class="keyword">private</span>:</div><div class="line"><a name="l00270"></a><span class="lineno">  270</span>&#160;        <span class="keyword">static</span> <span class="keywordtype">void</span> onEOS(_GstAppSink* sink, <span class="keywordtype">void</span>* user_data);</div><div class="line"><a name="l00271"></a><span class="lineno">  271</span>&#160;        <span class="keyword">static</span> GstFlowReturn onPreroll(_GstAppSink* sink, <span class="keywordtype">void</span>* user_data);</div><div class="line"><a name="l00272"></a><span class="lineno">  272</span>&#160;        <span class="keyword">static</span> GstFlowReturn onBuffer(_GstAppSink* sink, <span class="keywordtype">void</span>* user_data);</div><div class="line"><a name="l00273"></a><span class="lineno">  273</span>&#160;</div><div class="line"><a name="l00274"></a><span class="lineno">  274</span>&#160;        <a class="code" href="classgstCamera.html">gstCamera</a>();</div><div class="line"><a name="l00275"></a><span class="lineno">  275</span>&#160;</div><div class="line"><a name="l00276"></a><span class="lineno">  276</span>&#160;        <span class="keywordtype">bool</span> init( <a class="code" href="group__gstCamera.html#ga785111db387205d710d3a087c2ad3091">gstCameraSrc</a> src );</div><div class="line"><a name="l00277"></a><span class="lineno">  277</span>&#160;        <span class="keywordtype">bool</span> buildLaunchStr( <a class="code" href="group__gstCamera.html#ga785111db387205d710d3a087c2ad3091">gstCameraSrc</a> src );</div><div class="line"><a name="l00278"></a><span class="lineno">  278</span>&#160;        <span class="keywordtype">bool</span> parseCameraStr( <span class="keyword">const</span> <span class="keywordtype">char</span>* camera );</div><div class="line"><a name="l00279"></a><span class="lineno">  279</span>&#160;</div><div class="line"><a name="l00280"></a><span class="lineno">  280</span>&#160;        <span class="keywordtype">void</span> checkMsgBus();</div><div class="line"><a name="l00281"></a><span class="lineno">  281</span>&#160;        <span class="keywordtype">void</span> checkBuffer();</div><div class="line"><a name="l00282"></a><span class="lineno">  282</span>&#160;        </div><div class="line"><a name="l00283"></a><span class="lineno">  283</span>&#160;        _GstBus*     mBus;</div><div class="line"><a name="l00284"></a><span class="lineno">  284</span>&#160;        _GstAppSink* mAppSink;</div><div class="line"><a name="l00285"></a><span class="lineno">  285</span>&#160;        _GstElement* mPipeline;</div><div class="line"><a name="l00286"></a><span class="lineno">  286</span>&#160;        <a class="code" href="group__gstCamera.html#ga785111db387205d710d3a087c2ad3091">gstCameraSrc</a> mSource;</div><div class="line"><a name="l00287"></a><span class="lineno">  287</span>&#160;</div><div class="line"><a name="l00288"></a><span class="lineno">  288</span>&#160;        std::string  mLaunchStr;</div><div class="line"><a name="l00289"></a><span class="lineno">  289</span>&#160;        std::string  mCameraStr;</div><div class="line"><a name="l00290"></a><span class="lineno">  290</span>&#160;</div><div class="line"><a name="l00291"></a><span class="lineno">  291</span>&#160;        uint32_t mWidth;</div><div class="line"><a name="l00292"></a><span class="lineno">  292</span>&#160;        uint32_t mHeight;</div><div class="line"><a name="l00293"></a><span class="lineno">  293</span>&#160;        uint32_t mDepth;</div><div class="line"><a name="l00294"></a><span class="lineno">  294</span>&#160;        uint32_t mSize;</div><div class="line"><a name="l00295"></a><span class="lineno">  295</span>&#160;</div><div class="line"><a name="l00296"></a><span class="lineno">  296</span>&#160;        <span class="keyword">static</span> <span class="keyword">const</span> uint32_t NUM_RINGBUFFERS = 16;</div><div class="line"><a name="l00297"></a><span class="lineno">  297</span>&#160;        </div><div class="line"><a name="l00298"></a><span class="lineno">  298</span>&#160;        <span class="keywordtype">void</span>* mRingbufferCPU[NUM_RINGBUFFERS];</div><div class="line"><a name="l00299"></a><span class="lineno">  299</span>&#160;        <span class="keywordtype">void</span>* mRingbufferGPU[NUM_RINGBUFFERS];</div><div class="line"><a name="l00300"></a><span class="lineno">  300</span>&#160;        </div><div class="line"><a name="l00301"></a><span class="lineno">  301</span>&#160;        <a class="code" href="classEvent.html">Event</a> mWaitEvent;</div><div class="line"><a name="l00302"></a><span class="lineno">  302</span>&#160;        <a class="code" href="classMutex.html">Mutex</a> mWaitMutex;</div><div class="line"><a name="l00303"></a><span class="lineno">  303</span>&#160;        <a class="code" href="classMutex.html">Mutex</a> mRingMutex;</div><div class="line"><a name="l00304"></a><span class="lineno">  304</span>&#160;        </div><div class="line"><a name="l00305"></a><span class="lineno">  305</span>&#160;        uint32_t mLatestRGBA;</div><div class="line"><a name="l00306"></a><span class="lineno">  306</span>&#160;        uint32_t mLatestRingbuffer;</div><div class="line"><a name="l00307"></a><span class="lineno">  307</span>&#160;        <span class="keywordtype">bool</span>     mLatestRetrieved;</div><div class="line"><a name="l00308"></a><span class="lineno">  308</span>&#160;        </div><div class="line"><a name="l00309"></a><span class="lineno">  309</span>&#160;        <span class="keywordtype">void</span>*  mRGBA[NUM_RINGBUFFERS];</div><div class="line"><a name="l00310"></a><span class="lineno">  310</span>&#160;        <span class="keywordtype">bool</span>   mRGBAZeroCopy; <span class="comment">// were the RGBA buffers allocated with zeroCopy?</span></div><div class="line"><a name="l00311"></a><span class="lineno">  311</span>&#160;        <span class="keywordtype">bool</span>   mStreaming;        <span class="comment">// true if the device is currently open</span></div><div class="line"><a name="l00312"></a><span class="lineno">  312</span>&#160;        <span class="keywordtype">int</span>    mSensorCSI;        <span class="comment">// -1 for V4L2, &gt;=0 for MIPI CSI</span></div><div class="line"><a name="l00313"></a><span class="lineno">  313</span>&#160;</div><div class="line"><a name="l00314"></a><span class="lineno">  314</span>&#160;        <span class="keyword">inline</span> <span class="keywordtype">bool</span> csiCamera()<span class="keyword"> const           </span>{ <span class="keywordflow">return</span> (mSensorCSI &gt;= 0); }</div><div class="line"><a name="l00315"></a><span class="lineno">  315</span>&#160;};</div><div class="line"><a name="l00316"></a><span class="lineno">  316</span>&#160;</div><div class="line"><a name="l00317"></a><span class="lineno">  317</span>&#160;<span class="preprocessor">#endif</span></div><div class="ttc" id="group__gstCamera_html_gga785111db387205d710d3a087c2ad3091aa2b01206d25737bf103c037cf4925403"><div class="ttname"><a href="group__gstCamera.html#gga785111db387205d710d3a087c2ad3091aa2b01206d25737bf103c037cf4925403">GST_SOURCE_NVCAMERA</a></div><div class="ttdef"><b>Definition:</b> gstCamera.h:43</div></div>
<div class="ttc" id="classgstCamera_html_a01e94b6f2abedad9ab760dd68b828e80"><div class="ttname"><a href="classgstCamera.html#a01e94b6f2abedad9ab760dd68b828e80">gstCamera::GetWidth</a></div><div class="ttdeci">uint32_t GetWidth() const</div><div class="ttdoc">Return the width of the camera. </div><div class="ttdef"><b>Definition:</b> gstCamera.h:234</div></div>
<div class="ttc" id="classgstCamera_html"><div class="ttname"><a href="classgstCamera.html">gstCamera</a></div><div class="ttdoc">MIPI CSI and V4L2 camera capture using GStreamer and nvarguscamerasrc or v4l2src elements. </div><div class="ttdef"><b>Definition:</b> gstCamera.h:70</div></div>
<div class="ttc" id="classMutex_html"><div class="ttname"><a href="classMutex.html">Mutex</a></div><div class="ttdoc">A lightweight mutual exclusion lock. </div><div class="ttdef"><b>Definition:</b> Mutex.h:35</div></div>
<div class="ttc" id="group__gstCamera_html_gga785111db387205d710d3a087c2ad3091ad6c785a043fa1eeb687356169f6fc11e"><div class="ttname"><a href="group__gstCamera.html#gga785111db387205d710d3a087c2ad3091ad6c785a043fa1eeb687356169f6fc11e">GST_SOURCE_NVARGUS</a></div><div class="ttdef"><b>Definition:</b> gstCamera.h:44</div></div>
<div class="ttc" id="classgstCamera_html_a93371e3811a1956ff96c154fd1da23f2"><div class="ttname"><a href="classgstCamera.html#a93371e3811a1956ff96c154fd1da23f2">gstCamera::CaptureRGBA</a></div><div class="ttdeci">bool CaptureRGBA(float **image, uint64_t timeout=UINT64_MAX, bool zeroCopy=false)</div><div class="ttdoc">Capture the next image frame from the camera and convert it to float4 RGBA format, with pixel intensities ranging between 0.0 and 255.0. </div></div>
<div class="ttc" id="classgstCamera_html_abe5444efa860b29c8ce2dff6e3e16dcd"><div class="ttname"><a href="classgstCamera.html#abe5444efa860b29c8ce2dff6e3e16dcd">gstCamera::GetPixelDepth</a></div><div class="ttdeci">uint32_t GetPixelDepth() const</div><div class="ttdoc">Return the pixel bit depth of the camera (measured in bits). </div><div class="ttdef"><b>Definition:</b> gstCamera.h:246</div></div>
<div class="ttc" id="classgstCamera_html_a42ab558b8ff9a0bf47b768c5122825b7"><div class="ttname"><a href="classgstCamera.html#a42ab558b8ff9a0bf47b768c5122825b7">gstCamera::DefaultHeight</a></div><div class="ttdeci">static const uint32_t DefaultHeight</div><div class="ttdoc">Default camera height, unless otherwise specified during Create() </div><div class="ttdef"><b>Definition:</b> gstCamera.h:267</div></div>
<div class="ttc" id="classgstCamera_html_a1df842937128e70d8f140c65e88e783c"><div class="ttname"><a href="classgstCamera.html#a1df842937128e70d8f140c65e88e783c">gstCamera::~gstCamera</a></div><div class="ttdeci">~gstCamera()</div><div class="ttdoc">Release the camera interface and resources. </div></div>
<div class="ttc" id="group__gstCamera_html_ga82c0d21c049992867131001bbb9169af"><div class="ttname"><a href="group__gstCamera.html#ga82c0d21c049992867131001bbb9169af">gstCameraSrcToString</a></div><div class="ttdeci">const char * gstCameraSrcToString(gstCameraSrc src)</div><div class="ttdoc">Stringize function to convert gstCameraSrc enum to text. </div></div>
<div class="ttc" id="group__gstCamera_html_ga785111db387205d710d3a087c2ad3091"><div class="ttname"><a href="group__gstCamera.html#ga785111db387205d710d3a087c2ad3091">gstCameraSrc</a></div><div class="ttdeci">gstCameraSrc</div><div class="ttdoc">Enumeration of camera input source methods. </div><div class="ttdef"><b>Definition:</b> gstCamera.h:41</div></div>
<div class="ttc" id="classgstCamera_html_af8043c610d01bcde93f212f5f5bb0fe1"><div class="ttname"><a href="classgstCamera.html#af8043c610d01bcde93f212f5f5bb0fe1">gstCamera::Close</a></div><div class="ttdeci">void Close()</div><div class="ttdoc">Stop streaming the camera. </div></div>
<div class="ttc" id="classgstCamera_html_a7142cbf3d2251c023967affa0625ac74"><div class="ttname"><a href="classgstCamera.html#a7142cbf3d2251c023967affa0625ac74">gstCamera::IsStreaming</a></div><div class="ttdeci">bool IsStreaming() const</div><div class="ttdoc">Check if the camera is streaming or not. </div><div class="ttdef"><b>Definition:</b> gstCamera.h:146</div></div>
<div class="ttc" id="classgstCamera_html_a4ca28a9fc888afe4ff0a6542de351f56"><div class="ttname"><a href="classgstCamera.html#a4ca28a9fc888afe4ff0a6542de351f56">gstCamera::ConvertRGBA</a></div><div class="ttdeci">bool ConvertRGBA(void *input, float **output, bool zeroCopy=false)</div><div class="ttdoc">Convert an image to float4 RGBA that was previously aquired with Capture(). </div></div>
<div class="ttc" id="group__gstCamera_html_gga785111db387205d710d3a087c2ad3091a77873b0e7f5d0ca158d898fbb90894e5"><div class="ttname"><a href="group__gstCamera.html#gga785111db387205d710d3a087c2ad3091a77873b0e7f5d0ca158d898fbb90894e5">GST_SOURCE_V4L2</a></div><div class="ttdef"><b>Definition:</b> gstCamera.h:45</div></div>
<div class="ttc" id="classgstCamera_html_a211a6c9359a2f43054771f15e7628a5e"><div class="ttname"><a href="classgstCamera.html#a211a6c9359a2f43054771f15e7628a5e">gstCamera::DefaultWidth</a></div><div class="ttdeci">static const uint32_t DefaultWidth</div><div class="ttdoc">Default camera width, unless otherwise specified during Create() </div><div class="ttdef"><b>Definition:</b> gstCamera.h:262</div></div>
<div class="ttc" id="Mutex_8h_html"><div class="ttname"><a href="Mutex_8h.html">Mutex.h</a></div></div>
<div class="ttc" id="classgstCamera_html_a8c0cbb34989ca19042be8b90c176fc47"><div class="ttname"><a href="classgstCamera.html#a8c0cbb34989ca19042be8b90c176fc47">gstCamera::GetHeight</a></div><div class="ttdeci">uint32_t GetHeight() const</div><div class="ttdoc">Return the height of the camera. </div><div class="ttdef"><b>Definition:</b> gstCamera.h:239</div></div>
<div class="ttc" id="Event_8h_html"><div class="ttname"><a href="Event_8h.html">Event.h</a></div></div>
<div class="ttc" id="classEvent_html"><div class="ttname"><a href="classEvent.html">Event</a></div><div class="ttdoc">Event object for signalling other threads. </div><div class="ttdef"><b>Definition:</b> Event.h:33</div></div>
<div class="ttc" id="classgstCamera_html_a6f02cf79d67b1c204f53a1c7fa369374"><div class="ttname"><a href="classgstCamera.html#a6f02cf79d67b1c204f53a1c7fa369374">gstCamera::GetSize</a></div><div class="ttdeci">uint32_t GetSize() const</div><div class="ttdoc">Return the size (in bytes) of a camera frame from Capture(). </div><div class="ttdef"><b>Definition:</b> gstCamera.h:257</div></div>
<div class="ttc" id="classgstCamera_html_a1747140a15dd83dbd3593c375bbc85d0"><div class="ttname"><a href="classgstCamera.html#a1747140a15dd83dbd3593c375bbc85d0">gstCamera::Create</a></div><div class="ttdeci">static gstCamera * Create(const char *camera=NULL)</div><div class="ttdoc">Create a MIPI CSI or V4L2 camera device. </div></div>
<div class="ttc" id="classgstCamera_html_a1ae42b24f1ccb8056252614aae6779e5"><div class="ttname"><a href="classgstCamera.html#a1ae42b24f1ccb8056252614aae6779e5">gstCamera::Capture</a></div><div class="ttdeci">bool Capture(void **cpu, void **cuda, uint64_t timeout=UINT64_MAX)</div><div class="ttdoc">Capture the next image frame from the camera. </div></div>
<div class="ttc" id="classgstCamera_html_a075aa94acb72f577f7c385e37a8c15b0"><div class="ttname"><a href="classgstCamera.html#a075aa94acb72f577f7c385e37a8c15b0">gstCamera::Open</a></div><div class="ttdeci">bool Open()</div><div class="ttdoc">Begin streaming the camera. </div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_54a0acf6da04fe2ed9410b4c6369bc5d.html">jetson-utils</a></li><li class="navelem"><a class="el" href="gstCamera_8h.html">gstCamera.h</a></li>
    <li class="footer">Generated on Thu Sep 26 2019 12:19:11 for Jetson Inference by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  </ul>
</div>
</body>
</html>
